/*
 * Copyright (C) 2020 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package vip.justlive.easyproxy.core.context;

import lombok.Data;
import vip.justlive.oxygen.core.config.ValueConfig;
import vip.justlive.oxygen.ioc.annotation.Bean;

/**
 * 配置信息
 *
 * @author wubo
 */
@Data
@Bean
@ValueConfig("easy-proxy")
public class Config {

  public static final String REMOTE = "remote";
  public static final String TOKEN = "tk";
  public static final String HTTP_PROXY_AUTH_PREFIX = "easy-proxy.httpProxy.auth.";
  public static final String AIO_CONFIG = "aio.config";
  public static final String AIO_PROXY_CONFIG = "aio.proxy-config";
  public static final String CLIENT_PROXY_AIO_CONFIG = "aio.client-proxy-config";
  public static final String HTTP_PROXY_AIO_CONFIG = "aio.http-proxy-config";

  private Admin admin = new Admin();
  private HttpProxy httpProxy = new HttpProxy();
  private Server server = new Server();

  @Data
  public static class Admin {

    private String username;
    private String password;
    private String store;
  }

  @Data
  public static class Server {

    private String host;
    private int port;
    private String authKey;
  }

  @Data
  public static class HttpProxy {

    private boolean enabled;
    private boolean auth;
    private String host;
    private int port;
  }
}
